﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace TestMonkey.Core.Templates
{
    public class PropertyNull : PropertyTemplateProcessor
    {
        public override bool ShouldRun(Type type, PropertyInfo property)
        {
            return property.CanRead && property.CanWrite && property.PropertyType.IsClass && property.GetIndexParameters().Count()==0;
        }

        public override string PartialTemplateFileName(Type type, PropertyInfo property)
        {
            var trailer = "";
            if (property.PropertyType == typeof(string))
                trailer = "-String";

            return base.PartialTemplateFileName(type, property) + trailer;
        }
    }
}
